<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<script src="/static/jquery/jquery-1.8.2.min.js"></script>
<html>
<head>
    <title>Title</title>
</head>
<body>
<h2>体检项目表查询</h2>
<form action="/doManage/getPeitemsList" method="post">
    <select name="queryTypeid">
        <c:if test="${itemtypeList!=null}">
            <option value="">--请选择--</option>
            <c:forEach items="${itemtypeList}" var="itemtype">
                <option
                        <c:if test="${itemtype.typeid==queryTypeid}">selected="selected"</c:if>
                        value="${itemtype.typeid}">${itemtype.typename}</option>
            </c:forEach>
        </c:if>
    </select>
    <input type="submit" value="查询">
</form>
<table border="1px">
    <tr>
        <th>项目名称</th>
        <th>所属类别</th>
        <th>是否必查</th>
        <th>参考值</th>
        <th>价格</th>
        <th>说明</th>
        <th>操作</th>
    </tr>
    <c:if test="${peitemsList!=null}">
        <c:forEach items="${peitemsList}" var="peitems">
            <tr>
                <td>${peitems.itemname}</td>
                <td>${peitems.typename}</td>
                <td>${peitems.necessary}</td>
                <td>${peitems.ref}</td>
                <td>${peitems.price}</td>
                <td>${peitems.info}</td>
                <td><a class="modifyPeitem" itemid="${peitems.itemid}">修改</a></td>
            </tr>
        </c:forEach>
    </c:if>

</table>
</body>
</html>
<script>
    <%--href = "/doManage/toModifyView?itemid=" + ${peitems.itemid}--%>
        $(".modifyPeitem").on("click", function () {
            var obj = $(this);
            var itemid = obj.attr("itemid");
            window.location.href = "/doManage/toModifyView?itemid=" + obj.attr("itemid");
        })
</script>